home *** CD-ROM | disk | FTP | other *** search
- '*************************************************************************************************
- '
- ' SETUPLIB.MST
- '
- ' Companion script for C/C++ SETUPLIB.LIB
- '
- ' Client must provide a script called START.MST (which is $INCLUDE'd by this script) containing
- ' the label SL_START.
- '
- ' (C) Copyright 1995 by Mark of the Unicorn, Inc.
- '
- '*************************************************************************************************
-
-
- '*************************************************************************************************
- ' standard script includes
- '*************************************************************************************************
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
- '$INCLUDE 'msregdb.inc'
-
-
- '*************************************************************************************************
- ' resource ids
- '
- ' NOTE: these are symbolic names for string resources that must be provided in client DLL
- '*************************************************************************************************
- CONST ERR_SL_UNKNOWN = 1
- CONST ERR_SL_NOT_INSTALLED = 2
-
-
- '*************************************************************************************************
- ' possible ORable values for the flags parameter of DoMsgBox
- '*************************************************************************************************
- CONST MB_OKCANCEL = 1
- CONST MB_ABORTRETRYIGNORE = 2
- CONST MB_YESNOCANCEL = 3
- CONST MB_YESNO = 4
- CONST MB_RETRYCANCEL = 5
- CONST MB_ICONSTOP = 16
- CONST MB_ICONQUESTION = 32
- CONST MB_ICONEXCLAMATION = 48
- CONST MB_ICONINFORMATION = 64
-
-
- '*************************************************************************************************
- ' standard command ids
- '*************************************************************************************************
- CONST IDOK = 1
- CONST IDCANCEL = 2
- CONST IDABORT = 3
- CONST IDRETRY = 4
- CONST IDIGNORE = 5
- CONST IDYES = 6
- CONST IDNO = 7
-
-
- '*************************************************************************************************
- ' import procedures from SETUPLIB.DLL
- '*************************************************************************************************
- DECLARE FUNCTION sl_Init LIB "SETUPLIB.DLL" (hwnd%, pszSrcPath$) AS INTEGER
- DECLARE SUB sl_Uninit LIB "SETUPLIB.DLL"
- DECLARE FUNCTION sl_MessageBox LIB "SETUPLIB.DLL" (pszMsg$, uFlags%) AS INTEGER
- DECLARE FUNCTION sl_MessageBoxFromId LIB "SETUPLIB.DLL" (uMsgId%, uFlags%) AS INTEGER
- DECLARE FUNCTION sl_MessageBoxFormatFromId_s LIB "SETUPLIB.DLL" (uFmtId%, psz1$, uFlags%) AS INTEGER
- DECLARE SUB sl_RememberSpawnedWindow LIB "setuplib.dll"
- DECLARE SUB sl_ShowHelpTopic LIB "setuplib.dll" (pszHelpFileSpec$, uContextID%)
-
- DECLARE SUB sl_DebugString LIB "SETUPLIB.DLL" (psz$)
-
-
- '*************************************************************************************************
- '
- ' INIT
- '
- ' NOTE: This is the main entry point of script soley because it is the first label appear in it!
- '
- '*************************************************************************************************
- INIT:
- GOSUB SL_STARTUP
- GOTO SL_START
-
-
- '*************************************************************************************************
- SL_STARTUP:
- ' initialize the setup library...
- Result% = sl_Init(HwndFrame(), GetSymbolValue("STF_SRCDIR"))
- IF Result = 0 THEN
- GOTO SL_FAIL
- END IF
- RETURN
-
-
- '*************************************************************************************************
- SL_SHUTDOWN:
- ' shutdown the setup library
- sl_Uninit
- RETURN
-
-
- '*************************************************************************************************
- '
- ' SL_FAIL
- '
- '*************************************************************************************************
- SL_FAIL:
- NotUsed% = sl_MessageBoxFromId(ERR_SL_UNKNOWN, MB_OK + MB_ICONSTOP + MB_TASKMODAL)
- GOTO SL_END
-
-
- '*************************************************************************************************
- '
- ' SL_QUERY_QUIT
- '
- ' NOTE: Returns if user decides not to quit; otherwise, does not return and quits the script.
- '
- '*************************************************************************************************
- SL_QUERY_QUIT:
- Result% = sl_MessageBoxFromId(ERR_SL_NOT_INSTALLED, MB_YESNO + MB_ICONQUESTION + MB_TASKMODAL)
-
- IF Result% = IDYES THEN
- GOTO SL_END
- ELSE
- RETURN
- END IF
-
-
- '*************************************************************************************************
- ' start client script here
- '
- ' NOTE: Client script must contain SL_START and eventually goto SL_END, SL_FAIL or SL_QUERY_QUIT
- ' to properly exit.
- '
- ' Also, the client's SL_START routine should set the following symbols:
- '
- ' SYM_SL_SETUP_TITLE
- ' SYM_SL_NEEDS_CTL3D (actually, can be set any time before SL_END)
- '
- '*************************************************************************************************
- '$INCLUDE 'start.mst'
-
-
- '*************************************************************************************************
- '
- ' QUIT
- '
- ' NOTE: This label is included solely because the standard headers GOTO it if their error
- ' handling decides to abort.
- '
- '*************************************************************************************************
- QUIT:
- GOTO SL_END
-
-
- '*************************************************************************************************
- '
- ' SL_END
- '
- ' Called by client script at some point after SL_START is called by this script
- '
- '*************************************************************************************************
- SL_END:
- UIPopAll
- GOSUB SL_SHUTDOWN
-
-